package edu.humc.dao;

import edu.humc.pojo.Recycle;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("RecycleMapper")
public interface RecycleMapper {
//    通过id查找当前用户删除的内容
    @Select("select * from recycle where id=#{id}")
    List<Recycle> SelectRecycleById(int id);
//    删除回收站内的内容
    @Delete("delete from recycle where mid=#{mid}")
    int DeleteRecycleById(String mid);
//    通过留言Id查找留言内容
    @Select("select * from recycle where mid=#{mid}")
    Recycle SelectRecycleByMid(String mid);
    //    恢复留言
    @Insert("insert into messagetable values(#{mid},#{mdate},#{mtype},#{mtitle},#{mcontent},#{id})")
    int RecoverMessage(Recycle recycle);
}
